home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00b.txt / 000106_icon-group-sender_Wed Oct 25 07:48:36 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id e9PElbT08852
  4.     for icon-group-addresses; Wed, 25 Oct 2000 07:47:37 -0700 (MST)
  5. Message-Id: <200010251447.e9PElbT08852@baskerville.CS.Arizona.EDU>
  6. Delivered-To: fixup-icon-group@CS.Arizona.EDU@fixme
  7. Date: Tue, 24 Oct 2000 18:23:38 -0600
  8. From: Cheyenne Wills <cheyenne_wills@qwest.net>
  9. X-Accept-Language: en
  10. To: icon-group@cs.arizona.edu
  11. Subject: Re: How to "declare" a string? (and forget how to do it :)
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14. Content-Length: 835
  15.  
  16. Yesterday I posted a "solution" then posted a fix to that solution and
  17. even that was wrong (thanks to those who pointed it out)
  18.  
  19. The original "fixed" code looked like:
  20.  
  21. procedure main()
  22.     repeat {
  23.          /count := 5
  24.          ((10 >= count) +:= 2)| break
  25.     }
  26. end
  27.  
  28. is wrong.
  29.  
  30. I had gotten my wires crossed with which operators produce values versus
  31. those that produce variables.
  32.  
  33. The relationship operators ( =, <=, >=, etc.) produce values, while
  34. operators such as ( /, \, op:=, etc.) produce variables.
  35.  
  36. So.. here is the final (hopefully) example..
  37.  
  38. procedure main()
  39.     repeat {
  40.         /count := 5
  41.         (count := (10 >= count) + 2) | break
  42.     }
  43. end
  44.  
  45. Of course this is obscured code and could be written alot "cleaner"
  46.  
  47. Again sorry about the brain check. (and that should teach me to post
  48. "untested" code <grin>)
  49.  
  50. Cheyenne
  51.